package BookManage.Operation;

import BookManage.Book;

import java.util.List;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 强仔
 * Date: 2022-01-19
 * Time: 10:29
 */
public class FindByNameOperation implements IOperation {
    @Override
    public void work() {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入所要查询的书的名字:");
        List<Book> books = bookDao.findsBooksByName(scanner.next());
        if(books == null){
            System.out.println("查无此书");
        }
        for (Book book : books) {
            System.out.println(book);
        }
    }
}
